/********************************************************************************
  DESCRIPTION OF THE FILE HERE
********************************************************************************/

#include "response.h"
#include "common.h"

typedef struct SResponse {  
  int value;
} Response;

static void Response_init(ptrResponse response, int v){
  response->value = v;
}

ptrResponse Response_create(int v){
  ptrResponse response = new(Response);
  Response_init(response, v);
  return response;
}

ptrResponse Response_createFromDataStream(void * stream){
  ptrResponse res;
  res = Response_create(*(int *)stream);
  return res;
}

void * Response_toDataStream(ptrResponse response){
  void * res;
  res = (void *)&response->value;
  return res;
}

void Response_printf (ptrResponse response){
  printf("Response = %d\n", response->value);
}

static void Response_deinit(ptrResponse response){
  /* do nothing */
};

void Response_destroy(ptrResponse response){
  if (response != NULL){
    Response_deinit(response);
    delete(response);
  }
}
